package com.jz.community.modulemine.ui.activity;

import android.support.v7.widget.Toolbar;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView;

import com.gyf.barlibrary.ImmersionBar;
import com.jz.community.basecomm.base.BaseMvpActivity;
import com.jz.community.basecomm.mvp.BaseMvpPresenter;
import com.jz.community.basecomm.utils.Preconditions;
import com.jz.community.basecomm.utils.WpToast;
import com.jz.community.modulemine.R;
import com.jz.community.modulemine.R2;

import butterknife.BindView;

/**
 * Created by Admin on 2018/4/4 0004.
 */

public class FeedbackActivity extends BaseMvpActivity {

    @BindView(R2.id.title_back)
    ImageButton titleBack;
    @BindView(R2.id.title_name)
    TextView titleName;
    @BindView(R2.id.edit_feedback)
    EditText editFeedback;
    @BindView(R2.id.user_tel)
    EditText userTel;
    @BindView(R2.id.user_email)
    EditText userEmail;
    @BindView(R2.id.button_submit)
    Button buttonSubmit;
    @BindView(R2.id.title_toolbar)
    Toolbar titleToolbar;


    @Override
    protected int getContentView() {
        return R.layout.module_mine_activity_feedback;
    }


    @Override
    protected void initView() {
        ImmersionBar.with(this)
                .titleBar(titleToolbar)
                .statusBarDarkFont(true, 0.2f)//当白色背景状态栏遇到不能改变状态栏字体为深色的设备时，解决方案
                .keyboardEnable(true)
                .init();
        titleName.setText(R.string.feedback);
    }

    @Override
    protected BaseMvpPresenter createPresenter() {
        return null;
    }

    @Override
    protected void addListener() {
        titleBack.setOnClickListener(v -> finish());
        buttonSubmit.setOnClickListener(v -> {
            String text = editFeedback.getText().toString();
            String user_tel = userTel.getText().toString();
            String user_email = userEmail.getText().toString();
            if (!Preconditions.isNullOrEmpty(text)) {
                WpToast.l(this, "提交成功");
            } else {
                WpToast.l(this, "您还没填写您的意见呢");
            }
        });
    }

}
